package org.example.seata.bs.api.feign.account.factory;

import org.example.seata.bs.api.feign.account.RemoteAccountService;
import org.example.seata.bs.api.feign.account.fallback.RemoteAccountServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author hzq
 * @date 2021/11/30 16:22
 */
@Component
public class RemoteAccountServiceFallbackFactory implements FallbackFactory<RemoteAccountService> {

    @Override
    public RemoteAccountService create(Throwable cause) {
        RemoteAccountServiceFallbackImpl fallback = new RemoteAccountServiceFallbackImpl();
        fallback.setCause(cause);
        return fallback;
    }
}
